#ifndef CURRENT_CONTROL_LOOP_H
#define CURRENT_CONTROL_LOOP_H

#include "../ControlLoop.h"

class CurrentControlLoop : public ControlLoop {
private:
    // 为电流环单独添加d轴和q轴PI控制器
    PIController dAxisController;
    PIController qAxisController;

public:
    CurrentControlLoop(float kp, float ki, float integralLimit, float outputLimit, float dcBusVoltage = 12.0f);

    // 重写execute方法，允许设置d轴和q轴电流目标
    void execute(float angle, float targetId = 0.0f, float targetIq = 0.0f);

    // 重载execute方法，兼容基类接口
    void execute(float angle) override;
};

#endif // CURRENT_CONTROL_LOOP_H